#include <tsin/library/BulletVanishEvent.hpp>

#include <tsin/runtime/GameRuntime.hpp>
#include <tsin/runtime/BulletRuntime.hpp>

#include <tsin/library/GameViewport.hpp>

#include <tsin/util/Logger.hpp>

#include <cstring>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace tsin;

BulletVanishEvent::BulletVanishEvent(bool d)
        : BulletEvent(d)
{
}

DynamicObject *BulletVanishEvent::copy()
{
        return DynamicObject::copy(new BulletVanishEvent(true));
}

void BulletVanishEvent::init()
{
}

void BulletVanishEvent::reinit()
{
        switch(nrArguments) {
        case 0:
                init();
                break;
        }
}

bool BulletVanishEvent::trigger(BulletRuntime &bullet, void *)
{
        return true;
}

BulletEvent *BulletVanishEvent::handle(BulletRuntime &bullet, void *)
{
        bullet.stage = BULLET_STAGE_VANISHING;
        return next();
}

DynamicObject *bindVanishEvent()
{
        return new BulletVanishEvent(true);
}
